<?php
/* pChart library inclusions */ 
 include("class/pData.class.php"); 
 include("class/pDraw.class.php"); 
 include("class/pPie.class.php"); 
 include("class/pImage.class.php"); 

 
/* Create and populate the pData object */ 
$MyData = new pData();    
$MyData->addPoints(array(40,30,20,99999,55,6,445345),"ScoreA");   
$MyData->setSerieDescription("ScoreA","Application A"); 
 
/* Define the absissa serie */ 
$MyData->addPoints(array("A","B","C"),"Labels"); 
$MyData->setAbscissa("Labels"); 
 
/* Create the pChart object */ 
$myPicture = new pImage(800,600,$MyData,TRUE); 
 
/* Draw a solid background */ 
$Settings = array("R"=>173, "G"=>255, "B"=>217, "Dash"=>1, "DashR"=>193, "DashG"=>172, "DashB"=>237); 
$myPicture->drawFilledRectangle(0,0,799,529,$Settings); 
 
/* Draw a gradient overlay */ 

/* Add a border to the picture */ 
$myPicture->drawRectangle(0,0,799,529,array("R"=>0,"G"=>0,"B"=>0)); 
 
/* Write the picture title */  
$myPicture->setFontProperties(array("FontName"=>"fonts/Silkscreen.ttf","FontSize"=>6)); 
$myPicture->drawText(10,13,"pPie - Draw 3D pie charts",array("R"=>255,"G"=>255,"B"=>255)); 
 
/* Set the default font properties */  
$myPicture->setFontProperties(array("FontName"=>"fonts/Forgotte.ttf","FontSize"=>18,"R"=>80,"G"=>80,"B"=>80)); 
 
/* Create the pPie object */  
$PieChart = new pPie($myPicture,$MyData); 
 
/* Define the slice color */ 
$PieChart->setSliceColor(0,array("R"=>143,"G"=>197,"B"=>0)); 
 
/* Draw a simple pie chart */  

/* Draw an AA pie chart */  
$PieChart->draw3DPie(340,300,array("DrawLabels"=>TRUE,"Border"=>TRUE,"WriteValues"=>TRUE,"DataGapRadius"=>2,"DataGapAngle"=>4, "Radius" => 200)); 
 
/* Enable shadow computing */  
$myPicture->setShadow(TRUE,array("X"=>3,"Y"=>3,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>10)); 
 
/* Write the legend */ 
$myPicture->setFontProperties(array("FontName"=>"fonts/pf_arma_five.ttf","FontSize"=>12)); 
$myPicture->setShadow(TRUE,array("X"=>1,"Y"=>1,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20)); 

/* Write the legend box */  
$myPicture->setFontProperties(array("FontName"=>"fonts/Silkscreen.ttf","FontSize"=>18,"R"=>0,"G"=>255,"B"=>255)); 
$PieChart->drawPieLegend(600,8,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_VERTICAL)); 
 
/* Render the picture (choose the best way) */ 
$myPicture->stroke("pictures/example.draw3DPie.png"); 


?>
